package wangm.controller;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;

/**
 * description
 *
 * @author zk
 * @since 2018/7/7
 */
@Aspect
@Component
public class AroundTest implements Ordered {

    @Pointcut(value = "@annotation(org.springframework.web.bind.annotation.RequestMapping))")
    public void aroundCut(){
    }

    @Around(value = "aroundCut()")
    public void aournd(ProceedingJoinPoint joinPoint) throws Throwable {
        System.out.println("around before");
        joinPoint.proceed();
        System.out.println("around after");
    }

    @Override
    public int getOrder() {
        return -83223;
    }
}
